package com.cskaoyan.controller.wxstorage;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.vo.system.ObjCreateVo;
import com.cskaoyan.service.system.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.text.ParseException;

/**
 * @auther zk
 * @date 2022/7/21 23:17
 */

@RestController
@RequestMapping("wx/storage")
public class WxStorageController {

    @Autowired
    StorageService storageService;

    @RequestMapping("upload")
    public BaseRespVo wxStorageUpload(MultipartFile file) throws IOException, ParseException {
        ObjCreateVo objCreateVo = storageService.addObjOp(file);
        return BaseRespVo.ok(objCreateVo, "成功", 0);
    }


}
